﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RuEn;
using TestingRule;

namespace RuEn_Test
{
    public class Test_BO : BaseBusinessObject<Test_BO>
    {

        [RequiredStringRule]
        public string Address
        {
            get; set;
        }

        [RequiredStringRule("Error: Required Rule Failed")]
        [RegExRule(@"\w+\@\w+\.com", "Error: RegEx Rule Failed")]
        [LengthRule(20, 2, "Error: Length Rule Failed")]
        [ComparerStringRule("test_comparer", "Error: Comparision Rule Failed", ComparerEnum.Equel)]
        public string Name
        {
            get;
            set;
        }

        [ComparerStringRule("test_comparer", "Error: Comparision Rule Failed", ComparerEnum.NotEquel)]
        public string Email
        {
            get;
            set;
        }

        [ComparerIntRule(10, "Error: Comparision Rule Failed", ComparerEnum.GreaterThan)]
        public int Age1
        {
            get;
            set;
        }

        [ComparerIntRule(5, "Error: Comparision Rule Failed", ComparerEnum.LessThan)]
        public int Age2
        {
            get;
            set;
        }
    }
}
